package com.iotechn.unimall.app.api.integralactivity;

import com.iotechn.unimall.core.annotation.HttpMethod;
import com.iotechn.unimall.core.annotation.HttpOpenApi;
import com.iotechn.unimall.core.annotation.HttpParam;
import com.iotechn.unimall.core.annotation.HttpParamType;
import com.iotechn.unimall.core.annotation.param.NotNull;
import com.iotechn.unimall.core.exception.ServiceException;
import com.iotechn.unimall.data.domain.IntegralUserDO;
import com.iotechn.unimall.data.domain.RewardLadderDO;
import com.iotechn.unimall.data.dto.integralactivity.IntegralGoodsDTO;
import com.iotechn.unimall.data.dto.integralactivity.InviteLogMiniAppDTO;

import java.util.List;

@HttpOpenApi(group = "integralActivity", description = "积分商场活动")
public interface IntegralActivityService {

    @HttpMethod(description = "获取积分商品列表")
    public List<IntegralGoodsDTO> IntegralGoodsList()  throws ServiceException;

    @HttpMethod(description = "获取积分商品详情")
    public IntegralGoodsDTO IntegralGoodsDetail(
            @NotNull @HttpParam(name = "integerGoodsId", type = HttpParamType.COMMON, description = "积分活动id") Long integerGoodsId) throws ServiceException;

    @HttpMethod(description = "获取积分优惠券列表")
    public List<Object> IntegralCouponList(
            @NotNull @HttpParam(name = "userId", type = HttpParamType.USER_ID, description = "userId") Long userId
    )  throws ServiceException;

    @HttpMethod(description = "兑换优惠券")
    public Object exchangeCoupon(
            @NotNull @HttpParam(name = "IntegralGoodsId", type = HttpParamType.COMMON, description = "积分活动id") Long IntegralGoodsId,
            @NotNull @HttpParam(name = "userId", type = HttpParamType.USER_ID, description = "userId") Long userId) throws ServiceException;

    @HttpMethod(description = "兑换商品")
    public void exchangeGoods(
            @NotNull @HttpParam(name = "IntegralGoodsId", type = HttpParamType.COMMON, description = "积分活动id") Long IntegralGoodsId,
            @NotNull @HttpParam(name = "goodsId", type = HttpParamType.COMMON, description = "商品Id") Long goodsId,
            @NotNull @HttpParam(name = "userId", type = HttpParamType.USER_ID, description = "userId") Long userId) throws ServiceException;

    /**
     * 根据用户信息获取用户的积分
     * @param userId
     * @return
     * @throws ServiceException
     */
    @HttpMethod(description = "获取用户的积分信息")
    public IntegralUserDO getUserDoByUserId(
            @NotNull @HttpParam(name = "userId", type = HttpParamType.USER_ID, description = "userId") Long userId) throws ServiceException;


    @HttpMethod(description = "邀请奖励列表")
    public List<RewardLadderDO> getInvitereward(
            @NotNull @HttpParam(name = "userId", type = HttpParamType.USER_ID, description = "userId") Long userId
    )throws ServiceException;

    @HttpMethod(description = "邀请成功列表")
    public List<InviteLogMiniAppDTO> getInviteSuccessList(
            @NotNull @HttpParam(name = "userId", type = HttpParamType.USER_ID, description = "userId") Long userId
    )throws ServiceException;

}
